GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer *user_data);
+static gboolean page_range_entry_focus_changed (GtkWidget *entry,
+ GParamSpec *pspec,
+ GtkPrintUnixDialog *dialog);
static void update_page_range_entry_sensitivity(GtkWidget *button,
GtkPrintUnixDialog *dialog);
static void update_print_at_entry_sensitivity (GtkWidget *button,
gtk_widget_class_bind_template_callback (widget_class, error_dialogs);
gtk_widget_class_bind_template_callback (widget_class, emit_ok_response);
gtk_widget_class_bind_template_callback (widget_class, selected_printer_changed);
+ gtk_widget_class_bind_template_callback (widget_class, page_range_entry_focus_changed);
gtk_widget_class_bind_template_callback (widget_class, update_page_range_entry_sensitivity);
gtk_widget_class_bind_template_callback (widget_class, update_print_at_entry_sensitivity);
gtk_widget_class_bind_template_callback (widget_class, update_print_at_option);
}
}
+static gboolean
+page_range_entry_focus_changed (GtkWidget *entry,
+ GParamSpec *pspec,
+ GtkPrintUnixDialog *dialog)
+{
+ GtkPrintUnixDialogPrivate *priv = gtk_print_unix_dialog_get_instance_private (dialog);
+
+ if (gtk_widget_has_focus (entry))
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->page_range_radio), TRUE);
+
+ return FALSE;
+}
+
static void
update_page_range_entry_sensitivity (GtkWidget *button,
GtkPrintUnixDialog *dialog)
active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button));
- gtk_widget_set_sensitive (priv->page_range_entry, active);
-
if (active)
gtk_widget_grab_focus (priv->page_range_entry);
}
</child>
<child>
<object class="GtkEntry" id="page_range_entry">
- <property name="sensitive">0</property>
<property name="can-focus">1</property>
<property name="tooltip-text" translatable="yes">Specify one or more page ranges,
e.g. 1–3, 7, 11</property>
<property name="activates-default">1</property>
+ <signal name="notify::has-focus" handler="page_range_entry_focus_changed" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="page_range_entry-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Pages</property>